home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Apple II Sample Code / MPW IIGS SC / SC.022.AutoLaunch / autolaunch.r < prev    next >
Encoding:
Text File  |  1990-06-22  |  9.7 KB  |  434 lines  |  [TEXT/MPS ]

  1. #include "typesiigs.r" 
  2.  
  3. /***/
  4.  
  5. #define MainWindow        $1000
  6. #define AppLaunch        1
  7. #define AppTriggerText    10
  8. #define AppTriggerData    11
  9. #define AppTargetText    12
  10. #define AppTargetData    13
  11. #define AppTimerText    14
  12. #define AppTimerData    15
  13. #define AppUnitText        16
  14.  
  15. /***/
  16.  
  17. #define AboutWindow        $2000
  18. #define AboutOK            1
  19. #define AboutText        2
  20.  
  21. /***/
  22.  
  23. /*------------------------ Startup Record -----------------------*/
  24.  
  25. resource rToolStartup (1)    {
  26.     mode640,                            /* master SCB */
  27.     {     
  28.         3,$0300,  /* misc tools */
  29.         4,$0301,  /* quickdraw */
  30.         5,$0302,  /* desk manager */
  31.         6,$0300,  /* eventMgr */
  32.         7,$0200,  /* scheduler */
  33. /*      8,$0301,  /* sound tools */
  34. /*      9,$0201,  /* ADB tools */
  35. /*      10,$0202, /* SANE */
  36.         11,$0200, /* int math */
  37.         14,$0301, /* Window Manager */
  38.         15,$0301, /* Menu Manager */
  39.         16,$0301, /* Control Manager */
  40.         18,$0301, /* QD Aux */
  41. /*      19,$0300, /* print manager */
  42.         20,$0301, /* LineEdit tool set */
  43.         21,$0302, /* Dialog Manager */
  44.         22,$0300, /* Scrap manager */
  45.         23,$0301, /* standard file */
  46. /*      25,$0104, /* NoteSynth */
  47. /*      26,$0104, /* Note Seq */
  48.         27,$0301, /* Font manager */
  49.         28,$0301, /* list manager */
  50. /*      29,$0101, /* ACE */
  51. /*      32,$0103, /* Midi Tools */
  52. /*      34,$0101  /* text edit */
  53.     }
  54. };
  55.  
  56.  
  57. /*---------------------------------------------------------------------------*/
  58. /*
  59. /* About Window
  60. /*
  61. /* This is the template for the about window, with controls.
  62. /*
  63. /*---------------------------------------------------------------------------*/
  64.  
  65. resource rWindParam1 (AboutWindow) {
  66.     fVis+fAlert,                                            /* Frame Bits            */
  67.     0,                                                        /* title ID               */
  68.     0,                                                        /* ref Con                */
  69.     {0,0,0,0},                                                /* Zoom Rect              */
  70.     0,                                                        /* color table id         */
  71.     {0,0},                                                    /* origin                 */
  72.     {0,0},                                                    /* data size             */
  73.     {0,0},                                                    /* max height-width        */
  74.     {0,0},                                                    /* scroll amount, hor,ver */
  75.     {0,0},                                                    /* page amount */
  76.     0,                                                        /* wInfo Ref Con */
  77.     0,                                                        /* wInfo height */
  78.     {$15,$A0,$BA,$1E0},                                        /* window Position */
  79.     infront,                                                /* wPlane */
  80.     AboutWindow,                                            /* Control Ref */
  81.     refIsResource*0x0100+resourceToResource                  /* descriptor */
  82. };
  83.  
  84. /********/
  85.  
  86. resource rControlList (AboutWindow) {
  87.     {
  88.         AboutWindow+AboutText,
  89.         AboutWindow+AboutOK
  90.     }
  91. };
  92.  
  93. /********/
  94.  
  95. resource rControlTemplate (AboutWindow+AboutText) {
  96.     AboutText,
  97.     {$10,$20,$81,$120},
  98.     StatTextControl{{
  99.         ctlInactive,                        /* flag */
  100.         fctlProcNotPtr+RefIsResource,        /* more flags */
  101.         0,
  102.         AboutWindow+AboutText
  103.     }};
  104. }; 
  105.  
  106. /********/
  107.  
  108. resource rTextForLETextBox2 (AboutWindow+AboutText) {
  109.     TBCenterJust
  110.     TBStyleOutline
  111.     "AutoLaunch"
  112.     TBEndOfLine
  113.     TBStylePlain
  114.     "A program to automatically launch freshly-built applications over the network."
  115.     TBEndOfLine
  116.     TBEndOfLine
  117.     "by"
  118.     TBEndOfLine
  119.     "Eric Soldan"
  120.     TBEndOfLine
  121.     TBEndOfLine
  122.     "Copyright Apple Computer, Inc."
  123.     TBEndOfLine
  124.     "All Rights Reserved"
  125.     TBEndOfLine
  126.     "Version 3.0"
  127. };
  128.  
  129. /********/
  130.  
  131. resource rControlTemplate (AboutWindow+AboutOK) {
  132.     AboutOK,
  133.     {$88,$90,0,0},
  134.     SimpleButtonControl{{
  135.         DefaultButton,
  136.         fCtlWantsEvents+fctlProcNotPtr+RefIsResource,
  137.         0,                        /* ref con */
  138.         AboutWindow+AboutOK,    /* title ref */
  139.         0,                        /* color table not used */
  140.         {"\015","\015",0,0}        /* key equiv */
  141.     }};
  142. };
  143. resource rpString (AboutWindow+AboutOK) {"OK"};
  144.  
  145.  
  146. /*---------------------------------------------------------------------------*/
  147. /*
  148. /* Main Window
  149. /*
  150. /* This is the template for the main window, with controls.
  151. /*
  152. /*---------------------------------------------------------------------------*/
  153.  
  154. resource rWindParam1 (MainWindow) {
  155.     fTitle+fMove,                                    /* Frame Bits -- title is a drag */
  156.     MainWindow,                                        /* title ID               */
  157.     0,                                                /* ref Con                */
  158.     {0,0,0,0},                                        /* Zoom Rect              */
  159.     0,                                                /* color table id         */
  160.     {0,0},                                            /* origin                 */
  161.     {0,0},                                            /* data size             */
  162.     {0,0},                                            /* max height-width        */
  163.     {0,0},                                            /* scroll amount, hor,ver */
  164.     {0,0},                                            /* page amount */
  165.     0,                                                /* wInfo Ref Con */
  166.     0,                                                /* wInfo height */
  167.     {60,100,140,540},                                /* window Position */
  168.     infront,                                        /* wPlane */
  169.     MainWindow,                                        /* Control Ref */
  170.     refIsResource*0x0100+resourceToResource          /* descriptor */
  171. };
  172. resource rPString (MainWindow) {"AutoLaunch"};
  173.  
  174. /********/
  175.  
  176. resource rControlList (MainWindow) {
  177.     {
  178.         MainWindow+AppLaunch,
  179.         MainWindow+AppTriggerText,
  180.         MainWindow+AppTriggerData,
  181.         MainWindow+AppTargetText,
  182.         MainWindow+AppTargetData,
  183.         MainWindow+AppTimerText,
  184.         MainWindow+AppTimerData,
  185.         MainWindow+AppUnitText
  186.     }
  187. };
  188.  
  189. /********/
  190.  
  191. resource rControlTemplate (MainWindow+AppLaunch) {
  192.     AppLaunch,
  193.     {56,220-100,70,220+100},
  194.     SimpleButtonControl{{
  195.         DefaultButton,
  196.         fCtlWantsEvents+fctlProcNotPtr+RefIsResource,
  197.         0,                    /* ref con */
  198.         MainWindow+AppLaunch,    /* title ref */
  199.         0,                        /* color table not used */
  200.         {"\015","\015",0,0}        /* key equiv */
  201.     }};
  202. };
  203. resource rpString (MainWindow+AppLaunch) {"Launch Application"};
  204.  
  205. /********/
  206.  
  207. resource rControlTemplate (MainWindow+AppTriggerText) {
  208.     AppTriggerText,
  209.     {10,10,20,222},
  210.     StatTextControl{{
  211.         ctlInactive,                        /* flag */
  212.         fctlProcNotPtr+RefIsResource,        /* more flags */
  213.         0,
  214.         MainWindow+AppTriggerText
  215.     }};
  216. }; 
  217. resource rTextForLETextBox2 (MainWindow+AppTriggerText) {
  218.     "\$01J\$FF\$FFApplication trigger file:"
  219. };
  220.  
  221. /********/
  222.  
  223. resource rControlTemplate (MainWindow+AppTriggerData) {
  224.     AppTriggerData,
  225.     {10,234,20,400},
  226.     StatTextControl{{
  227.         ctlInactive,                        /* flag */
  228.         fctlProcNotPtr+RefIsPtr,            /* more flags */
  229.         0,                                    /* refCon */
  230.         0,                                    /* no resource (RefIsPtr) */
  231.         0,                                    /* text size */
  232.         0                                    /* left justify */
  233.     }};
  234. }; 
  235.  
  236. /********/
  237. /********/
  238.  
  239. resource rControlTemplate (MainWindow+AppTargetText) {
  240.     AppTargetText,
  241.     {20,10,30,222},
  242.     StatTextControl{{
  243.         ctlInactive,                        /* flag */
  244.         fctlProcNotPtr+RefIsResource,        /* more flags */
  245.         0,
  246.         MainWindow+AppTargetText
  247.     }};
  248. }; 
  249. resource rTextForLETextBox2 (MainWindow+AppTargetText) {
  250.     "\$01J\$FF\$FFApplication to launch:"
  251. };
  252.  
  253. /********/
  254.  
  255. resource rControlTemplate (MainWindow+AppTargetData) {
  256.     AppTargetData,
  257.     {20,234,30,400},
  258.     StatTextControl{{
  259.         ctlInactive,                        /* flag */
  260.         fctlProcNotPtr+RefIsPtr,            /* more flags */
  261.         0,                                    /* refCon */
  262.         0,                                    /* no resource (RefIsPtr) */
  263.         0,                                    /* text size */
  264.         0                                    /* left justify */
  265.     }};
  266. }; 
  267.  
  268. /********/
  269. /********/
  270.  
  271. resource rControlTemplate (MainWindow+AppTimerText) {
  272.     AppTimerText,
  273.     {36,10,46,222},
  274.     StatTextControl{{
  275.         ctlInactive,                        /* flag */
  276.         fctlProcNotPtr+RefIsResource,        /* more flags */
  277.         0,
  278.         MainWindow+AppTimerText
  279.     }};
  280. }; 
  281. resource rTextForLETextBox2 (MainWindow+AppTimerText) {
  282.     "\$01J\$FF\$FFTime between trigger tests:"
  283. };
  284.  
  285. /********/
  286.  
  287. resource rControlTemplate (MainWindow+AppTimerData) {
  288.     AppTimerData,
  289.     {34,234,47,234+12+4*8},
  290.     EditLineControl{{
  291.         0,
  292.         fctlCanBeTarget+fctlWantsEvents+fctlProcNotPtr+RefIsResource,
  293.         0,
  294.         4,                                /* Max Length */
  295.         MainWindow+AppTimerData
  296.     }};
  297. }; 
  298. resource rPString (MainWindow+AppTimerData) {"1"};
  299.  
  300. /********/
  301.  
  302. resource rControlTemplate (MainWindow+AppUnitText) {
  303.     AppUnitText,
  304.     {36,234+12+4*8+12,46,400},
  305.     StatTextControl{{
  306.         ctlInactive,                        /* flag */
  307.         fctlProcNotPtr+RefIsResource,        /* more flags */
  308.         0,
  309.         MainWindow+AppUnitText
  310.     }};
  311. }; 
  312. resource rTextForLETextBox2 (MainWindow+AppUnitText) {
  313.     "(in seconds)"
  314. };
  315.  
  316. /********/
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. /*********************************************************************/
  335. /*
  336. /*             Menus
  337. /*
  338. /*********************************************************************/
  339.  
  340. #define AppleMenuID        $901
  341. #define FileMenuID        $902
  342. #define EditMenuID        $903
  343.  
  344. #define UndoID             250
  345. #define CutID            251
  346. #define CopyID             252
  347. #define PasteID         253
  348. #define ClearID         254
  349. #define CloseID            255
  350.  
  351. #define AboutID            301
  352.  
  353. #define ChooseTriggerID    401
  354. #define ChooseTargetID    402
  355. #define SaveLaunchID    403
  356. #define QuitID            499
  357.  
  358. /********/
  359.  
  360. resource rMenuBar (1) {
  361.     {
  362.         AppleMenuID,FileMenuID,EditMenuID
  363.     };
  364. };
  365.  
  366. /********/
  367.  
  368. resource rMenu (AppleMenuID) {
  369.     AppleMenuID,0xA008,AppleMenuID,{
  370.         AboutID
  371.     };
  372. };
  373. resource rPString (AppleMenuID) {"@"};
  374.  
  375. /********/
  376.  
  377. resource rMenu (FileMenuID)    {
  378.     FileMenuID,0xA008,FileMenuID,{
  379.         ChooseTriggerID,ChooseTargetID,SaveLaunchID,CloseID,QuitID
  380.     };
  381. };
  382. resource rPString (FileMenuID) {" File "};
  383.  
  384. /********/
  385.  
  386. resource rMenu (EditMenuID)    {
  387.     EditMenuID,0xA008,EditMenuID,{
  388.         UndoID,CutID,CopyID,PasteID,ClearID
  389.     };
  390. };
  391. resource rPString (EditMenuID) {" Edit "};
  392.  
  393. /********/
  394.  
  395. resource rMenuItem (AboutID) {AboutID,"","",0,0x8040,AboutID};
  396. resource rPString (AboutID) {"About AutoLaunch..."};
  397.  
  398. /********/
  399.  
  400. resource rMenuItem (ChooseTriggerID) {ChooseTriggerID,"T","t",0,0x8000,ChooseTriggerID};
  401. resource rPString (ChooseTriggerID) {"Choose Trigger File..."};
  402.  
  403. resource rMenuItem (ChooseTargetID) {ChooseTargetID,"L","l",0,0x8000,ChooseTargetID};
  404. resource rPString (ChooseTargetID) {"Choose Application to Launch..."};
  405.  
  406. resource rMenuItem (SaveLaunchID) {SaveLaunchID,"S","s",0,0x8000,SaveLaunchID};
  407. resource rPString (SaveLaunchID) {"Save Application Launch Info"};
  408.  
  409. resource rMenuItem (CloseID) {CloseID,"W","w",0,0x8040,CloseID};
  410. resource rPString (CloseID) {"Close"};
  411.  
  412. resource rMenuItem (QuitID) {QuitID,"Q","q",0,0x8000,QuitID};
  413. resource rPString (QuitID) {"Quit"};
  414.  
  415. /********/
  416.  
  417. resource rMenuItem (UndoID) {UndoID,"","",0,0x8040,UndoID};
  418. resource rPString (UndoID) {"Undo"};
  419.  
  420. resource rMenuItem (CutID) {CutID,"X","x",0,0x8000,CutID};
  421. resource rPString (CutID) {"Cut"};
  422.  
  423. resource rMenuItem (CopyID)    {CopyID,"C","c",0,0x8000,CopyID};
  424. resource rPString (CopyID) {"Copy"};
  425.  
  426. resource rMenuItem (PasteID) {PasteID,"V","v",0,0x8000,PasteID};
  427. resource rPString (PasteID) {"Paste"};
  428.  
  429. resource rMenuItem (ClearID) {ClearID,"","",0,0x8000,ClearID};
  430. resource rPString (ClearID) {"Clear"};
  431.  
  432. /*************************************************************************/
  433.  
  434.